import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_ahj_app/base/utils/textUtils.dart';
import 'package:flutter_ahj_app/base/values/SQColor.dart';
import 'package:flutter_ahj_app/base/values/dimens.dart';

class LoadingWidget extends StatelessWidget {
  String content;
  Color bacColor;

  LoadingWidget({Key key, this.content, this.bacColor});

  @override
  Widget build(BuildContext context) {
    return Container(
      color: bacColor == null ? SQColor.white : bacColor,
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              CircularProgressIndicator(),
              Container(height: Dimens.dimens16),
              Text(TextUtils.getStr(content, defaultStr: "数据加载中..."),
                  style: TextStyle(
                      color: SQColor.per38Black, fontSize: Dimens.textSize28)),
            ],
          ),
        ],
      ),
    );
  }
}
